package com.twu.biblioteca;

import java.io.BufferedReader;
import java.io.IOException;

/**
 * Created with IntelliJ IDEA.
 * User: thoughtworker
 * Date: 10/14/13
 * Time: 9:47 AM
 * To change this template use File | Settings | File Templates.
 */
public class LogInAsGuestCommand implements Command {

    private Menu menu;
    private BufferedReader reader;
    private ValidateInMap validateInMap;

    public LogInAsGuestCommand(BufferedReader reader, Menu menu, ValidateInMap validateInMap) {
        this.menu = menu;
        this.reader = reader;
        this.validateInMap = validateInMap;
    }

    @Override
    public void execute() throws IOException {
        menu.displayGuestMenu();
        String userMenuChoice = reader.readLine();
        validateInMap.mapToMenu(userMenuChoice);
    }
}
